Add a reftest for gradients with hard stops
authorMatthias Clasen <mclasen@redhat.com>
Wed, 5 Aug 2020 12:09:42 +0000 (08:09 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Wed, 5 Aug 2020 12:10:35 +0000 (08:10 -0400)
This is testing the issue described in #1293.

No fix though, this is still broken in Vulkan.
It works correctly in GL and with cairo.

testsuite/reftests/gradient-hard-stop.css [new file with mode: 0644]
testsuite/reftests/gradient-hard-stop.ref.ui [new file with mode: 0644]
testsuite/reftests/gradient-hard-stop.ui [new file with mode: 0644]
testsuite/reftests/meson.build

diff --git a/testsuite/reftests/gradient-hard-stop.css b/testsuite/reftests/gradient-hard-stop.css
new file mode 100644 (file)
index 0000000..a93406f
--- /dev/null
@@ -0,0 +1,17 @@
+@import "reset-to-defaults.css";
+
+window {
+  background-color: black;
+}
+
+#reference {
+  background: linear-gradient(red 50%, yellow 50%);
+}
+
+#red {
+  background-color: red;
+}
+
+#yellow {
+  background-color: yellow;
+}
diff --git a/testsuite/reftests/gradient-hard-stop.ref.ui b/testsuite/reftests/gradient-hard-stop.ref.ui
new file mode 100644 (file)
index 0000000..7e92484
--- /dev/null
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" id="window1">
+    <property name="decorated">0</property>
+    <property name="default_width">200</property>
+    <property name="default_height">200</property>
+    <child>
+      <object class="GtkBox">
+        <property name="orientation">vertical</property>
+        <child>
+          <object class="GtkBox">
+            <property name="hexpand">1</property>
+            <property name="vexpand">1</property>
+            <property name="name">red</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkBox">
+            <property name="hexpand">1</property>
+            <property name="vexpand">1</property>
+            <property name="name">yellow</property>
+          </object>
+        </child>
+      </object>
+    </child>
+  </object>
+</interface>
diff --git a/testsuite/reftests/gradient-hard-stop.ui b/testsuite/reftests/gradient-hard-stop.ui
new file mode 100644 (file)
index 0000000..d7ae2bc
--- /dev/null
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<interface>
+  <object class="GtkWindow" id="window1">
+    <property name="decorated">0</property>
+    <property name="default_width">200</property>
+    <property name="default_height">200</property>
+    <property name="name">reference</property>
+  </object>
+</interface>
index 005f0d9ca946a65db2b045b55235856de60fadb0..816e370992d23ba63d415cddd5b805e4355ef773 100644 (file)
@@ -223,6 +223,9 @@ testdata = [
   'gtk-image-effect-inherit.css',
   'gtk-image-effect-inherit.ref.ui',
   'gtk-image-effect-inherit.ui',
+  'gradient-hard-stop.css',
+  'gradient-hard-stop.ref.ui',
+  'gradient-hard-stop.ui',
   'green-20x20.png',
   'grid-empty-with-spacing.ref.ui',
   'grid-empty-with-spacing.ui',